home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Frameworks / Grant's CGI Framework 1.0b12 / MyListSTARProcess.c < prev    next >
Text File  |  1995-12-09  |  2KB  |  85 lines

  1. /*****
  2.  *
  3.  *    Grant's CGI Shell (Common Grant Interface :-)
  4.  *        http://arpp1.carleton.ca/grant/mac/grantscgi.html
  5.  *
  6.  *    MyListSTARProcess.c
  7.  *
  8.  *    Application framework for CGIs and ListSTAR events.
  9.  *
  10.  *    MyListSTARProcess is where you will do your application specific processing
  11.  *  of the ListSTAR event.
  12.  *
  13.  *    Modify this file.
  14.  *
  15.  *    by Grant Neufeld
  16.  *
  17.  *    Copyright ©1995 by Grant Neufeld
  18.  *
  19.  *    http://arpp1.carleton.ca/grant/
  20.  *    gneufeld@ccs.carleton.ca
  21.  *    grant@acm.org
  22.  *
  23.  *    This source may be freely used as long as the copyright notice is kept in the source.
  24.  *    I ask that you let me know of any enhancements (read: bug fixes) to this code.
  25.  *    I would also like copies of (or discounts on) anything you produce using this code, please.
  26.  *
  27.  *****/
  28.  
  29. #include "MyConfiguration.h"
  30. #if kCompileWithListSTARCode
  31.  
  32. #include <string.h>
  33. #include <Threads.h>
  34.  
  35. #include "compiler_stuff.h"
  36. #include "globals.h"
  37.  
  38. #include "ListSTAR.h"
  39.         
  40.  
  41. /***  CUSTOM LISTSTAR EVENT FUNCTION  ***/
  42.  
  43. /* This function is where the ListSTAR event is actually processed.
  44.     You should replace its contents with your own.
  45.     (*theLStarHdl)->triggerValue should be positive if the event matches
  46.         your trigger requirements, zero if it doesn't, and negative if an
  47.         error occurred.
  48.     
  49.     (this function's prototype is defined in ListSTAR.h) */
  50. void
  51. MyListSTARProcess ( LStarHdl theLStarHdl )
  52. {
  53.     /* This example doesn't really do anything.
  54.         If used as a trigger, it always returns success */
  55.     *((*theLStarHdl)->triggerValue) = Trigger_success;
  56.     
  57.     /* you should try to make liberal use of yielding to other threads */
  58.     #if kCompileWithThreadsOptional
  59.     if ( gHasThreadMgr )
  60.     #endif
  61.     {
  62.         YieldToAnyThread ();
  63.     }
  64. } /* MyListSTARProcess */
  65.  
  66.  
  67. /***  CUSTOM LISTSTAR EVENT INITIALIZATION  ***/
  68. #pragma segment Startup
  69.  
  70. /* Put any of the initialization you need done, here.
  71.     This function will be called once: in-between the startup
  72.     sequence and the main event loop.
  73.     Return true if the initialization was successful, otherwise false.
  74.     An initialization failure will result in the application quitting. */
  75. Boolean
  76. MyListSTARStartup ( void )
  77. {
  78.     return true;
  79. } /* MyListSTARStartup */
  80.  
  81.  
  82. #endif    /* kCompileWithListSTARCode */
  83.  
  84. /*** EOF ***/
  85.